package com.meilingcloud.biobank.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.meilingcloud.biobank.domain.GeneralQuery;
import com.meilingcloud.biobank.domain.SampleBackup;
import com.meilingcloud.biobank.domain.dto.SampleQueryDto;
import com.meilingcloud.biobank.domain.dto.StatisticDto;
import com.meilingcloud.biobank.domain.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 样本复份 Mapper接口
 *
 * @author chenl
 * @date 2021-03-08
 */
public interface SampleBackupMapper extends BaseMapper<SampleBackup> {

    List<SampleBackup> queryList(SampleQueryDto dto);

    /**
     * 查询样本复份，包含已逻辑删除
     *
     * @param dto
     * @return
     */
    List<SampleBackup> queryListIncludeDeleted(SampleQueryDto dto);


    List<SampleBackup> generalQueryList(GeneralQuery generalQuery);

    List<SampleBackup> fuzzyQueryList(@Param("keyword") String keyword);

    List<SampleLifeCycleVo> getSampleLifeCycle(@Param("sampBackupId") Long sampBackupId);

    List<StatisticVo> chartByType(@Param("sampState") String sampState);

    List<StatisticVo> chartBySourceType(@Param("sampState") String sampState);

    List<StatisticVo> chartByGroup(@Param("sampState") String sampState);

    List<StatisticVo> chartByCreator(@Param("sampState") String sampState);

    List<StatisticVo> chartBySamplingTime(StatisticDto dto);

    List<StatisticVo> chartByStockTime(StatisticDto dto);

    List<StatisticVo> chartByExpired();

    List<SampTypeReportVo> reportBySampType(StatisticDto dto);

    List<SourceTypeReportVo> reportBySourceType(StatisticDto dto);

    List<SampGroupReportVo> reportBySampGroup(StatisticDto dto);

    List<SampleStatisticVo> statisticByType(@Param("sampState") String sampState);

    SampleBackup getInfoById(@Param("sampBackupId") Long sampBackupId);

    boolean updateSampleBackup(SampleBackup sampleBackup);
}
